package com.template.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wangqi
 * @date 2024-01-16 11:13
 */
public class FullTextMessage {
    private String title;
    private List<Paragraph> paragraphList;

    public String getTitle() {
        return title;
    }

    public List<Paragraph> getParagraphList() {
        return paragraphList;
    }

    public FullTextMessage setTitle(String title) {
        this.title = title;
        return this;
    }

    public FullTextMessage setParagraphList(List<Paragraph> paragraphList) {
        this.paragraphList = paragraphList == null ? new ArrayList<>() : paragraphList;
        return this;
    }

    public FullTextMessage(String title, List<Paragraph> paragraphList) {
        this.title = title;
        this.paragraphList = paragraphList == null ? new ArrayList<>() : paragraphList;
    }

    public FullTextMessage() {
        paragraphList = new ArrayList<>();
    }

    public FullTextMessage addParagraph(Paragraph paragraph) {
        this.paragraphList.add(paragraph);
        return this;
    }
}
